package com.dyz.leetcode._20_dynamicProgramming._516;

import java.util.ArrayList;
import java.util.List;

public class _516_longestPalindromeSubseq01 {
    private List<String> res = new ArrayList<>();

    public List<String> subSeqs(String s) {
        findSubSeq(s, 0, "");
        return res;
    }

    // start 参数用于剪枝
    private void findSubSeq(String s, int start, String subSeq) {
        if (start != 0) {res.add(subSeq);}

        for (int i = start; i < s.length(); i++) {
            findSubSeq(s, i + 1, subSeq + s.charAt(i));
        }
    }

    public static void main(String[] args) {
        System.out.println(new _516_longestPalindromeSubseq01().subSeqs("bbbabc"));
    }
}
